package org.batatasframework.common;

public abstract class NumberResolver {

	protected final static char[] CAPITAL_NAMES = { '零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖' };
	protected final static char[] CHINESE_NAMES = { '〇', '一', '二', '三', '四', '五', '六', '七', '八', '九' };
	protected final static int THE_NUMBER = 10;//个数，表示0~9的个数

	protected final String source;
	protected String message;
	
	protected NumberResolver(String source){
		this.source = source;
	}
	
	protected static boolean readNumber(char ch, StringBuilder reader){
		if('0' <= ch && ch <= '9'){
			reader.append(ch);
			return true;
		}
		
		for(int i = 0; i < THE_NUMBER; i++){
			if(CHINESE_NAMES[i] == ch || CAPITAL_NAMES[i] == ch){
				reader.append(i);
				return true;
			}
		}
		
		return false;
	}
	
	public boolean parse(){ return false; }

	@Override
	public String toString() {
		return message;
	}
}
